package com.regis.mapper;

import com.regis.entity.db.Category;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 纱雾休比酱
 * @description 针对表【category(菜品及套餐分类)】的数据库操作Mapper
 * @createDate 2022-07-28 03:58:08
 * @Entity com.regis.enity.Category
 */
@Mapper
public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select count(*) from dish inner join setmeal on dish.category_id = ${id} or setmeal.category_id = ${id}")
    Integer count(@Param("id") Long id);
}




